package com.icongyou.enterprise.talent_marking.controller;

import com.icongyou.enterprise.common.result.Result;
import com.icongyou.enterprise.talent_marking.entity.vo.SubmissionInfo;
import com.icongyou.enterprise.talent_marking.entity.dto.MarkPotential;
import com.icongyou.enterprise.talent_marking.service.HighPotentialSubmissionService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/potentialsubmission")
public class HighPotentialSubmissionConroller {
    @Resource
    private HighPotentialSubmissionService highPotentialSubmissionService;

    /**
     * 标记高潜力成果
     */
    @PostMapping("/mark")
    public Result markHighPotential(@RequestBody MarkPotential markPotential) {
        return highPotentialSubmissionService.markHighPotential(markPotential);
    }

    /**
     * 更新标记备注
     */
    @PostMapping("/update-remark")
    public Result updateRemark(@RequestBody MarkPotential markPotential){
        return highPotentialSubmissionService.updateRemark(markPotential);
    }

    /**
     * 取消高潜力标记
     */
    @PostMapping("/unmark")
    public Result unmarkHighPotential(@RequestBody MarkPotential markPotential){
        return highPotentialSubmissionService.unmarkHighPotential(markPotential);
    }

    /**
     * 获取用户标记的所有高潜力成果列表
     */
    @GetMapping("/my-marks")
    public Result getMyPotentialMarks(@RequestParam String userId){
        return highPotentialSubmissionService.getMyPotentialMarks(userId);
    }

    /**
     * 获取当前用户的高潜力成果详细信息列表
     */
    @GetMapping("/submission-info")
    public Result<List<SubmissionInfo>> getHighPotentialSubmissionInfo(@RequestParam String userId){
        return highPotentialSubmissionService.getHighPotentialSubmissionInfo(userId);
    }
}
